export default function textToNodes (textList, value) {
  const keywords = textList.map(item => {
    return item.keyword
  })
  const suggestKeywordNodes = []
  for (const keyword of keywords) {
    const nodes = []
    const key1 = keyword.slice(0, value.length)
    const node1 = {
      name: 'span',
      attrs: { style: 'color: #26ce8a' },
      children: [ { type: 'text', text: key1 } ]
    }
    nodes.push(node1)
    const key2 = keyword.slice(value.length)
    const node2 = {
      name: 'span',
      attrs: { style: 'color: #000' },
      children: [ { type: 'text', text: key2 } ]
    }
    nodes.push(node2)
    suggestKeywordNodes.push(nodes)
  }
  return suggestKeywordNodes
}